﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 第五次课堂作业
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        public bool IsSushu(int m)
        {
            if (m <= 1)
            {
                return false;
            }
            else
            {
                for(int i = 2; i <= m / 2; i++)
                {
                    if (m % i == 0)
                    {
                        return false;
                    }
                    return true;
                }
                return true;
            }
            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            for (int m = 6; m <= 100;m += 2)
            {
                for (int i = 2; i <= m / 2; i++)
                {
                    int j = m - i;
                    if (IsSushu(i) && IsSushu(j))
                    {
                        Sushu.Text += (m + "=" + i + "+" + j + "   ");
                    }
                }
                Sushu.Text += "\r\n";
            }
        }
    }
}
